<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <script>
      let url = encodeURIComponent(window.location.href); // 注意一定要encodeURIComponent
      let url2 =
        `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxcdc2c0cf4b992a7c&redirect_uri=${url}&response_type=code&scope=snsapi_userinfo&state=#wechat_redirect`
      window.location.href = url2
    </script>
  </body>
</html>
